package com.zerui.manager.devicegroup.domainservice;

import com.zerui.manager.devicegroup.DeviceGroup;
import com.zerui.manager.devicegroup.gateway.DeviceGroupGateWay;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * @Author wh
 * @create_time 2023-08-23 11:07
 */
@Component
public class DeviceGroupRepository {

	@Resource
	private DeviceGroupGateWay deviceGroupGateWay;

	public DeviceGroup selectById(Long supId) {
		return deviceGroupGateWay.selectById(supId);
	}

	public DeviceGroup getNodeByName(String orgName) {
		return deviceGroupGateWay.getNodeByName(orgName);
	}

	public void addDeviceGroup(DeviceGroup deviceGroup) {
		deviceGroupGateWay.addDeviceGroup(deviceGroup);
	}

	public void update(DeviceGroup deviceGroup) {
		deviceGroupGateWay.updateById(deviceGroup);
	}

	public void deleteById(Long id) {
		deviceGroupGateWay.deleteById(id);
	}

	public List<DeviceGroup> selectBatchIds(Set<Long> orgIds) {
		return deviceGroupGateWay.selectBatchIds(orgIds);
	}

	public void updateBatch(List<DeviceGroup> deviceGroups) {
		deviceGroupGateWay.updateBatch(deviceGroups);
	}

	public List<DeviceGroup> getDeviceGroupBySupId(Long supId) {
		return deviceGroupGateWay.getDeviceGroupBySupId(supId);
	}

	public Map<Long, DeviceGroup> getDeviceGroupMapByIds(Set<Long> deviceList) {
		return deviceGroupGateWay.getDeviceGroupMapByIds(deviceList);
	}
}
